package ru.paswd.marketprice.rest.app.mappers;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import ru.paswd.marketprice.rest.api.dto.PriceWithShop;
import ru.paswd.marketprice.rest.app.entity.Price;
import ru.paswd.marketprice.rest.app.entity.PriceHistoryItem;

@Mapper(componentModel = "spring")
public interface PriceMapper
        extends DtoMapper<PriceWithShop, Price> {

    @Override
    @Mapping(target = "distance", ignore = true)
    PriceWithShop toDto(Price entity);

    ru.paswd.marketprice.rest.api.dto.Price toDto(PriceHistoryItem item);

    @Mapping(target = "id", ignore = true)
    PriceHistoryItem toHistoryItem(Price price);
}
